<template>
<div>
  <Form>
    <FormItem >
      <Input v-model="form.name"></Input>
    </FormItem>
    <FormItem>
      <Input v-model="form.remarkers"></Input>
    </FormItem>
    <FormItem>
      <Button style="margin: 5px" type="primary" @click="updateClassify">提交</Button>
      <Button type="text" @click="quxiao">取消</Button>
    </FormItem>
  </Form>
</div>
</template>

<script>
export default {
  name: "UpdateClassify",
  props:["data"],
  data(){
    return{
      form:[]
    }
  },
  methods:{
    updateClassify(){
      this.http.post("/updateClassify",this.qs.parse(this.form)).then(res=>{
        if (res.data){
          this.$Message.success('修改成功啦')
          this.$emit('after')
          this.$emit('niubi')
        }else {
          this.$Message.error('添加失败')
        }
      })
    },
    quxiao(){
      this.$emit("niubi")
    }
  },
  created() {
    this.form=this.data
  }
}
</script>

<style scoped>

</style>
